package javase_class_250910;

import org.junit.Test;

/**
 * ClassName: TestOutOfMemoryError
 * Package: javase_class_250910
 * Description:
 *
 * @Author harkjeans
 * @Create 2025/9/10 14:53
 * @Version 1.0
 */
public class TestOutOfMemoryError {
    @Test
    public void test02(){
        //OutOfMemoryError
        //方式一：
        int[] arr = new int[Integer.MAX_VALUE];
    }
    @Test
    public void test03(){
        //OutOfMemoryError
        //方式二：
        StringBuilder s = new StringBuilder();
        while(true){
            s.append("atguigu");
        }
    }
}
